package com.wuyou.simple;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * 面试题 17.04. 消失的数字
 */
public class MissingNumber {


    public int solution_1(int[] nums) {
        int res = 0;
        Arrays.sort(nums);
        for (int i = 0; i < nums.length; i++) {
            if(i != nums[i]){
                res = i;
                break;
            }
            if (i == nums.length - 1) {
                res = nums.length;
            }
        }
        return res;
    }
}
